package com.qf.Controller;

import com.qf.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/*
 *@Description:
 *@author:刘哥
 *@Date:86180 2022/9/19 16:44
 */
@RestController
public class TestController {
    //    @GetMapping("add")
//    public String add(){
//        return "傻逼";
//    }
    @Value("${springboot.user.name}")
    private String name;

    @Value("${springboot.user.address}")
    private String address;

    private User user;

    @Autowired
    public void setUser(User user) {
        this.user = user;
    }

    @GetMapping("/jieshao")
    public String test1() {
        return "我给你介绍一个男朋友";
    }

    @GetMapping("/name")
    public String getName() {
        return name;
    }

    @GetMapping("/address")
    public String getAddress() {
        return address;
    }


    @GetMapping("/user")
    public User getUser() {
        return user;
    }
}
